package com.wxg.controller;

import com.wxg.common.redis.annotation.RequestLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by void on 2019/6/18.
 */
@RestController
@RequestMapping("/index")
@RequestLimit(maxCount = 1,second = 10)
public class IndexController {

    /**
     * @RequestLimit 修饰在方法上，优先使用其参数
     * @return
     */
    @GetMapping("/test1")
    @RequestLimit(second = 30, maxCount = 5)
    public String test(){
        return "ok";
    }

    /**
     * @RequestLimit 修饰在类上，用的是类的参数
     * @return
     */
    @GetMapping("/test2")
    public String test2(){
        return "ok";
    }
}
